﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FlashCards.Model;

namespace FlashCards.WebApp.Models
{
    public class HomeModel
    {
        public HomeModel(List<Category> topLevelCategories, List<DevelopmentNews> news, int userId)
        {
            TopLevelCategories = new List<CategoryModel>();
            foreach (var item in topLevelCategories)
                TopLevelCategories.Add(new CategoryModel(item));

            LatestNews = new List<DevelopmentNewsModel>();
            foreach (var item in news)
                LatestNews.Add(new DevelopmentNewsModel(item));

            UserId = userId;
        }

        public List<CategoryModel> TopLevelCategories { get; set; }
        public List<DevelopmentNewsModel> LatestNews { get; set; }
        public int UserId { get; set; }
    }
}